package com.ms.hqu.db;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;


public class MSDaoGenerator {
	
	public static void main(String[] args) throws Exception {
		
		new MSDaoGenerator().generate();
	}
	
	private static final String PACKAGE = "com.hqu.ms.db";
	public static final int VERSION = 1;
	private Schema mSchema;
	
	public MSDaoGenerator(){
		mSchema = new Schema(VERSION, PACKAGE);
	}
	
	void addFavoriteTable(){
		Entity newTable = mSchema.addEntity("FavDB");
		newTable.addLongProperty("_id").columnName("_id").primaryKeyAsc().autoincrement();
		newTable.addLongProperty("mg_id");
		newTable.addStringProperty("mg_name");
		newTable.addStringProperty("mg_introduce");
		newTable.addStringProperty("mg_address");
		newTable.addStringProperty("mg_phone");
		newTable.addStringProperty("mg_picture");
		newTable.addDoubleProperty("mg_long");
		newTable.addDoubleProperty("mg_lati");
		newTable.addLongProperty("fav_date");
		
	}
	
	public void generate() throws Exception{
		addFavoriteTable();
		
		DaoGenerator generator = new DaoGenerator();
		generator.generateAll(mSchema, "../MS/gen-db");
		
	}
}
